<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Request;

/**
 * App\Models\BaseModel
 */
class BaseModel extends Model
{
    use HasFactory;


    /**
     * Notes: Prepare a date for array / JSON serialization.
     * @param \DateTimeInterface $date
     * @return string
     */
    protected function serializeDate(\DateTimeInterface $date) : string
    {
        return $date->format('Y-m-d H:i:s');
    }

    /**
     * Notes: 获取指定列信息
     * @param $keys
     * @param null $_
     * @return mixed
     */
    public function getKeys($keys, $_=null){
        foreach (func_get_args() as $key){
            $res[$key] = $this->$key;
        }
        return $res??[];
    }


}
